//主数据表格配置
export const columns = [
  { title: '发票号码', dataIndex: 'invoiceNo', key: 'invoiceNo', align: 'center', scopedSlots: { customRender: 'invoiceNo' } },
  { title: '发票代码', dataIndex: 'invoiceCode', key: 'invoiceCode', align: 'center' },
  { title: '发票种类', dataIndex: 'invoiceType', key: 'invoiceType', align: 'center' },
  // { title: '结算单号', dataIndex: 'settlementNo', key: 'settlementNo', align: 'center' },
  { title: '买方单位', dataIndex: 'customerName', key: 'customerName', align: 'center' },
  // { title: '关联销售订单', dataIndex: 'saleOrderNo', key: 'saleOrderNo', align: 'center' },
  // { title: '买方税号', dataIndex: 'customerTaxNo', key: 'customerTaxNo', align: 'center' },
  // { title: '买方地址电话', dataIndex: 'customerAddrTell', key: 'customerAddrTell', align: 'center' },
  // { title: '买方银行账号', dataIndex: 'customerAccountNum', key: 'customerAccountNum', align: 'center' },
  // { title: '开具单位', dataIndex: 'supplierOrgName', key: 'supplierOrgName', align: 'center' },
  // { title: '开具单位税号', dataIndex: 'supplierTaxNo', key: 'supplierTaxNo', align: 'center' },
  // { title: '开具单位地址电话', dataIndex: 'supplierAddrTel', key: 'supplierAddrTel', align: 'center' },
  // { title: '开具单位银行账号', dataIndex: 'supplierAccountNum', key: 'supplierAccountNum', align: 'center' },
  // { title: '红票标志', dataIndex: 'redFlag', key: 'redFlag', align: 'center' },
  // { title: '无税总价', dataIndex: 'totalIunitprice', key: 'totalIunitprice', align: 'center' ,scopedSlots: { customRender: 'tofixed2' } },
  { title: '含税总价', dataIndex: 'totalPrice', key: 'totalPrice', align: 'center', scopedSlots: { customRender: 'tofixed2' } },
  { title: '税率', dataIndex: 'tax', key: 'tax', align: 'center', scopedSlots: { customRender: 'percentage' } },
  // { title: '税额', dataIndex: 'taxes', key: 'taxes', align: 'center' },
  { title: '状态', dataIndex: 'invoiceState', key: 'invoiceState', align: 'center', scopedSlots: { customRender: 'invoiceState' } },
  {
    title: '操作',
    dataIndex: 'action',
    key: 'operation',
    width: 180,
    align: 'center',
    scopedSlots: { customRender: 'action' }
  }
]
//主数据明细columns
export const columnsDetail = []

//主数据查询配置
export const q_formInfos = [
  { label: '结算单号', name: 'settlementPid', type: 'settlementSelect', placeholder: '结算单号' },
  // { label: '关联销售订单', name: 'saleOrderNo', type: 'input', placeholder: '关联销售订单' },
  { label: '开票单位', name: 'supplierOrgName', type: 'input', placeholder: '开票单位' },
  // { label: '采购单位',name: 'customerPid',type: 'customer',placeholder: '采购单位'},
  { label: '发票种类', name: 'invoiceType', type: 'dicselect', dicName: 'invoiceClass', placeholder: '发票种类' },
  { label: '发票号码', name: 'invoiceNo', type: 'input', placeholder: '发票号码' },
  { label: ['查询', '重置'], type: 'botton' }
]

export const q_formDatas = {
  settlementPid: null,
  saleOrderNo: null,
  customerPid: null,
  supplierOrgName: null,
  invoiceType: null,
  invoiceNo: null
}

//添加主数据表单配置
export const s_FormInfo = [
  { label: '购方单位名称', name: 'customerName', type: 'invoiceInfoSelect', placeholder: '请输入购方单位名称' },
  { label: '购方单位税号', name: 'customerTaxNo', type: 'input', placeholder: '请输入购方单位税号' },
  { label: '购方单位地址电话', name: 'customerAddrTell', type: 'input', placeholder: '请输入购方单位地址电话' },
  { label: '购方单位银行账号', name: 'customerAccountNum', type: 'input', placeholder: '请输入购方单位银行账号' },

  { label: '开具单位', name: 'supplierOrgName', type: 'invoiceInfoSelect', placeholder: '请输入开具单位' },
  { label: '开具单位税号', name: 'supplierTaxNo', type: 'input', placeholder: '请输入开具单位税号' },
  { label: '开具单位地址电话', name: 'supplierAddrTel', type: 'input', placeholder: '请输入开具单位地址电话' },
  { label: '开具单位银行账号', name: 'supplierAccountNum', type: 'input', placeholder: '请输入开具单位银行账号' },

  { label: '发票种类', name: 'invoiceType', type: 'dicselect', dicName: 'invoiceClass', placeholder: '请输入发票种类' },
  {},
  { label: '发票号码', name: 'invoiceNo', type: 'input', placeholder: '请输入发票号码' },
  { label: '发票代码', name: 'invoiceCode', type: 'input', placeholder: '请输入发票代码' },
  // { label: '红票标志', name: 'redFlag', type: 'input', placeholder: '请输入红票标志' },
  { label: '无税总价', name: 'totalIunitprice', type: 'input', placeholder: '请输入无税总价' },
  { label: '含税总价', name: 'totalPrice', type: 'input', placeholder: '请输入含税总价' },
  { label: '税率', name: 'tax', type: 'dicselect', dicName: 'tax', placeholder: '请选择税率' },
  { label: '税额', name: 'taxes', type: 'input', placeholder: '请输入税额' },
  { label: ['保存', '重置'], type: 'botton' }
]
export const s_formDatas = {
  sysSeq: 0,
  pid: '',
  saleOrderNo: null,
  purOrderNo: null,
  customerOrgPid: null,
  settlementPid: null,
  settlementNo: null,
  customerName: null,
  customerTaxNo: null,
  customerAddrTell: null,
  customerAccountNum: null,
  supplierOrgName: null,
  supplierTaxNo: null,
  supplierAddrTel: null,
  supplierAccountNum: null,
  invoiceType: '蓝字发票',
  invoiceNo: null,
  invoiceCode: null,
  redFlag: null,
  totalIunitprice: null,
  totalPrice: null,
  tax: '13',
  taxes: null,
  invoiceState: null,
  child:null
}
export const s_rules = {
  invoiceType: [{ required: true, message: '发票类型必填', trigger: 'blur' }],
  supplierOrgName: [{ required: true, message: '开票单位必填', trigger: 'blur' }],
  invoiceNo: [{ required: true, message: '发票号码必填', trigger: 'blur' }],
  supplierName: [{ required: true, message: '供应商名称必选', trigger: 'blur' }],
  totalIunitprice: [{ required: true, message: '结算金额无税总价必填', trigger: 'change' }],
  totalPrice: [{ required: true, message: '结算金额含税总价必填', trigger: 'change' }],
}

//查看明细显示配置
export const infoDatas = [
  // { title: '结算单号', id: 'settlementNo', value: '' },
  // { title: '关联销售订单', id: 'saleOrderNo', value: '' },
  // { title: '关联采购订单', id: 'purOrderNo', value: '' },
  { title: '购方单位名称', id: 'customerName', value: '' },
  { title: '购方单位税号', id: 'customerTaxNo', value: '' },
  { title: '购方单位地址电话', id: 'customerAddrTell', value: '' },
  { title: '购方单位银行账号', id: 'customerAccountNum', value: '' },
  { title: '开具单位', id: 'supplierOrgName', value: '' },
  { title: '开具单位税号', id: 'supplierTaxNo', value: '' },
  { title: '开具单位地址电话', id: 'supplierAddrTel', value: '' },
  { title: '开具单位银行账号', id: 'supplierAccountNum', value: '' },
  { title: '发票种类', id: 'invoiceType', value: '' },
  { title: '发票号码', id: 'invoiceNo', value: '' },
  { title: '发票代码', id: 'invoiceCode', value: '' },
  { title: '红票标志', id: 'redFlag', value: '' },
  { title: '无税总价', id: 'totalIunitprice', value: '', style: 'fontWeight:bolder', toFixed2: true },
  { title: '含税总价', id: 'totalPrice', value: '', style: 'fontWeight:bolder', toFixed2: true },
  { title: '税率', id: 'tax', value: '',type:'percentage' },
  { title: '税额', id: 'taxes', value: '', style: 'fontWeight:bolder', toFixed2: true },
  { title: '状态', id: 'invoiceState', value: '' }
]

//开票商品colomns
export const productColomns = [
  { title: '品名', dataIndex: 'productNameZh', key: 'productNameZh', align: 'center', },
  // { title: '通用名', dataIndex: 'commonName', key: 'commonName', align: 'center' },
  { title: '生产企业名称', dataIndex: 'manufacturerZh', key: 'manufacturerZh', align: 'center', },
  { title: '规格', dataIndex: 'spec', key: 'spec', align: 'center' },
  // { title: '型号', dataIndex: 'model', key: 'model', align: 'center' },
  { title: '计量单位', dataIndex: 'measurement', key: 'measurement', align: 'center' },
  // { title: '需配送数量', dataIndex: 'num', key: 'num', align: 'center' ,scopedSlots: { customRender: 'num' }},
  { title: '单价(元)', dataIndex: 'iunitprice', key: 'iunitprice', align: 'center', scopedSlots: { customRender: 'tofixed2' } },
  { title: '批号', dataIndex: 'batchCode', key: 'batchCode', align: 'center' },
  { title: '生产日期', dataIndex: 'productDate', key: 'productDate', align: 'center' },
  { title: '有效期', dataIndex: 'expiryDate', key: 'expiryDate', align: 'center' },
  { title: '配送数量', dataIndex: 'num', key: 'num', align: 'center', scopedSlots: { customRender: 'num' } },
  { title: '总价(元)', dataIndex: 'totalPrice', key: 'totalPrice', align: 'center', scopedSlots: { customRender: 'totalPrice' } },
  { title: '状态', dataIndex: 'deliveryState', key: 'deliveryState', align: 'center' }
  // { title: '操作', dataIndex: 'action', key: 'operation', width: 180, align: 'center', scopedSlots: { customRender: 'action' }},
]
